<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
	<!--<style>-->
		<!--form input.form-control{-->
			<!--border: 0 none;-->
			<!--outline: 0 none;-->
			<!--box-shadow:unset;-->
		<!--}-->
	<!--</style>-->
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<input type="hidden" id="id" name="id">
			<div class='form-group'>
				<label class='col-md-2 control-label'>发布人id</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='userid' id='userid'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>问题类型</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='type' id='type'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>内容</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='content' id='content' >
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>内容图片</label>
				<div class='col-md-10'>
					<span id="imageUrl"></span>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>对方态度</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='DefendantAttitude' id='DefendantAttitude' >
				</div>
			</div>

			<div class='form-group'>
				<label class='col-md-2 control-label'>对方态度图片</label>
				<div class='col-md-10'>
					<span id="DefendantUrl"></span>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>我的诉求</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='MyAppeal' id='MyAppeal' >
				</div>
			</div>

			<div class='form-group'>
				<label class='col-md-2 control-label'>我的诉求图片</label>
				<div class='col-md-10'>
					<span id="myappealurl"></span>
				</div>
			</div>
			<!--我的诉求图片暂缺字段-->


			<div class='form-group'>
				<label class='col-md-2 control-label'>点击量</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='hot' id='hot' >
				</div>
			</div>

			<div class='form-group'>
				<label class='col-md-2 control-label'>回复数量</label>
				<div class='col-md-10'>
					<input class='form-control' type='text' name='replyNumber' id='replyNumber'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='mfflConsultationList.html'">返回</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
        $(document).ready(function(){
            $('input').attr('disabled','disabled');
        });

		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});

        function isEmpty(obj){
            if(typeof obj == "undefined" || obj == null || obj == ""){
                return true;
            }else{
                return false;
            }
        }
		
		initData();
		
		function initData(){
			var id = getUrlParam("id");
			if(id != ""){
				$.ajax({
					type : 'get',
					url : '/mfflConsultations/'+id,
					async : false,
					success : function(data) {
						$('#id').val(data.id);
						$('#userid').val(data.userid);
                        $('#type').val(data.type);
                        $('#content').val(data.content);

                        if (!isEmpty(data.imageUrl)) {
                            var imageUrlGroup = data.imageUrl.split(";");
                            var imageUrl ='';
                            for (var i = 0; i < imageUrlGroup.length; i++) {

                                imageUrl += '<a href="/statics'+(imageUrlGroup[i].substring(0,imageUrlGroup[i].indexOf('_'))+imageUrlGroup[i].substring(imageUrlGroup[i].indexOf('.'),imageUrlGroup[i].length))+'" target="_blank"><img src="/statics'+imageUrlGroup[i]+'"    height="120" width="120" ></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                            }
                            $('#imageUrl').html(imageUrl);
                        }
                        if (!isEmpty(data.defendantUrl)) {

                            var defendantUrlGroup = data.defendantUrl.split(";");
                            var defendantUrl ='';
                            for (var i = 0; i < defendantUrlGroup.length; i++) {
                                defendantUrl += '<a href="/statics'+(defendantUrlGroup[i].substring(0,defendantUrlGroup[i].indexOf('_'))+defendantUrlGroup[i].substring(defendantUrlGroup[i].indexOf('.'),defendantUrlGroup[i].length))+'" target="_blank"><img src="/statics'+defendantUrlGroup[i]+'"    height="120" width="120" ></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                            }
                            $('#defendantUrl').html(defendantUrl);
                        }

                        if (!isEmpty(data.myappealurl)) {
                            var myappealurlGroup = data.myappealurl.split(";");
                            var myappealurl ='';
                            for (var i = 0; i < myappealurlGroup.length; i++) {
                                myappealurl += '<a href="/statics'+(myappealurlGroup[i].substring(0,myappealurlGroup[i].indexOf('_'))+myappealurlGroup[i].substring(myappealurlGroup[i].indexOf('.'),myappealurlGroup[i].length))+'" target="_blank"><img src="/statics'+myappealurlGroup[i]+'"    height="120" width="120" ></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                            }
                            $('#myappealurl').html(myappealurl);
                        }

                        $('#DefendantAttitude').val(data.DefendantAttitude);
                        $('#hot').val(data.hot);
						$('#MyAppeal').val(data.MyAppeal);
						$('#replyNumber').val(data.replyNumber);

					}
				});
			}
		}

		
	</script>
</body>
</html>
